package com.sxygsj.baselibrary.adapter

import androidx.annotation.LayoutRes
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.entity.MultiItemEntity
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * Author: sxygsj
 * Date: 2021/3/9 15:30
 * Description: 多布局adapter
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
abstract class RecyclerBaseMultiItemAdapter<T : MultiItemEntity>:BaseMultiItemQuickAdapter<T,BaseViewHolder>{
    constructor() : super()
    constructor(data: MutableList<T>?) : super(data)
    override fun convert(holder: BaseViewHolder, item: T) {
        setConvert(holder,item)
    }
    abstract fun setConvert(holder: BaseViewHolder,item: T)


    //设置多布局
    fun setItemType(type: Int, layoutResId: Int){
        addItemType(type,layoutResId)
    }

}